<%@page language="java" import="java.util.*" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%>
<%@page import="bean.CaipinDAO"%>
<%@page import="bean.Caipin"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'example2.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text.css" href="styles.css">
	-->

  </head>
  
  <center><body style="background: url(images/222.png);background-size:100% 100% ; background-attachment: fixed">
    <h1>购物&mdash;&mdash;&mdash;&mdash;结账页面</h1><br/>
	 <% double sum=0,sum2=0;
	 String []arg=request.getParameterValues("check");
	 out.println("选择购买的商品是：");
	 for(int i=0;i<arg.length;i++){
	 if(arg[i].equals("32.0")){
	 out.print("佛跳墙"+"    ");
	 sum2=Double.parseDouble(arg[i]);
	 sum=sum+sum2;
	 }
	 else if(arg[i].equals("3.2")){out.print("煎饼"+"   "); sum2=Double.parseDouble(arg[i]);
	 sum=sum+sum2;}
	 else if(arg[i].equals("11.0")){out.print("11"+"   "); sum2=Double.parseDouble(arg[i]);
	 sum=sum+sum2;}
	 else if(arg[i].equals("3.6")){out.print("包子"+"   "); sum2=Double.parseDouble(arg[i]);
	 sum=sum+sum2;}
	 else if(arg[i].equals("4.8")){out.print("八宝粥"+"   "); sum2=Double.parseDouble(arg[i]);
	 sum=sum+sum2;}
	 else if(arg[i].equals("16.0")){out.print("宫保鸡丁"+"   "); sum2=Double.parseDouble(arg[i]);
	 sum=sum+sum2;}
	 }%><br/>
	 <%out.print("原总金额是:"+sum);
	 %>
	 <p><a href="pay.jsp">付款</a> </p>
  </body></center>
<html>


